import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../components/Login.vue";
import Home from "../components/Home.vue";
import Welcome from "../components/Welcome.vue";
import About from "../views/About.vue";
import Articles from "../views/Articles.vue";
import ArticleDetail from "../views/ArticleDetail.vue";
import Message from "../views/Message.vue";
import Project from "../views/Project.vue";
import Resume from "../views/Resume.vue";
import Timeline from "../views/Timeline.vue";
Vue.use(VueRouter);

const routes = [
    { path: "/", redirect: "/login" },
    { path: "/login", component: Login },
    {
        path: "/home",
        component: Home,
        redirect: "/welcome",
        children: [
            { path: "/welcome", component: Welcome },
            { path: "/about", component: About },
            { path: "/welcome", component: Welcome },
            { path: "/message", component: Message },
            { path: "/project", component: Project },
            { path: "/timeline", component: Timeline },
            { path: "/articles", component: Articles },
            { path: "/resume", component: Resume },
            {
                path: "/articleDetail",
                name: "articleDetail",
                component: ArticleDetail
            }
        ]
    }
];

const router = new VueRouter({
    mode: 'history',
    routes
});

export default router;